import http from './http'

export default {
  getCategories ({ gid, moduleName, ...params }) {
    return http.get(`api/category?_format=json&group_id=${gid}&module=${moduleName}`)
  },

  postCategory (data) {
    return http.post(`api/category`, data)
  },

  patchCategory ({ id, ...data }) {
    return http.patch(`api/category/${id}`, data)
  },

  deleteCategory (id) {
    return http.delete(`api/category/${id}`)
  }
}
